% Opgave 1

\subsection*{Indledning}

\subsection*{Opgave 3.2}

Find z-transformationen af følgende signaler og skitser de tilsvarende punkter og nulpunkter.

\textbf{(a)} \quad $x(n) = (1+n)u(n)$.

\begin{align*}
X(z) &= \sum_{n=0}^{\infty} (1+n)z^{-n} =  \sum_{n=0}^{\infty} z^{-n} + \sum_{n=0}^{\infty} nz^{-n} \\
&= \frac{1}{1-z^{-1}} + \frac{z^{-1}}{(1-z^{-1})^2}, \quad ROC: \, |z|>1 \\
&= \frac{z}{z-1} + \frac{1}{(z-1)^2},
\end{align*}
hvilket antyder at der haves et nulpunkt i 0, samt poler i -1.

\textbf{(b)} \quad $x(n) = (a^n+a^{-n})u(n)$.

\begin{align*}
X(z) &= \sum_{n=0}^{\infty} (a^n+a^{-n})z^{-n} =  \sum_{n=0}^{\infty} a^nz^{-n} + \sum_{n=0}^{\infty} a^{-n}z^{-n} \\
&= \sum_{n=0}^{\infty} a^nz^{-n} + \sum_{n=0}^{\infty} \frac{1}{a^n} \cdot 1^n z^{-n} = \frac{z}{z-a}+\frac{z}{(z-\frac{1}{a})^2}, \quad ROC: |z| > \left(|a|,\left|\frac{1}{a}\right|\right),
\end{align*}
hvilket antyder at der haves nulpunkter i 0 samt poler i a og $\frac{1}{a}$.

\textbf{(c)} \quad $x(n) = (-1)^n2^{-n}u(n)$.

\begin{align*}
x(n) &= (-1)^n\left(\frac{1}{2}\right)^n = \left(-\frac{1}{2}\right)^n \\
X(z) &= \sum_{n=0}^{\infty} \left(-\frac{1}{2}\right)^nz^{-n} = \frac{1}{1+\frac{1}{2}z^{-1}} \\
&= \frac{z}{z+\frac{1}{2}}, \quad ROC: |z|>\frac{1}{2},
\end{align*}
hvilket antyder der haves nulpunkt i 0 og en pol i $-\frac{1}{2}$.

\subsection*{Opgave 3.11}

Bestem ved "long division" den inverse z-transformation af:
\begin{align*}
X(z) = \frac{1+2z^{-1}}{1-2z^{-1}+z^{-2}},
\end{align*}
hvis signalet $x(n)$ er: \\
\textbf{(a)} \quad causal

\[
\renewcommand\arraystretch{1.1}
\begin{array}
{*2r @{\hskip\arraycolsep}c@{\hskip\arraycolsep} *6r}
  &         &         &&      1 & +4z^{-1} & +7z^{-2} & + 10z^{-3} & + 13z^{-4} \\
\cline{4-9}
1 & -2z^{-1} & +z^{-2} &\big)& 1 & +2z^{-1} &          &            &            \\
  &         &         &&     -1 & +2z^{-1} & -z^{-2}  &            &            \\
\cline{5-7}
  &         &         &&        &  4z^{-1} & -z^{-2}  &&\\
  &         &         &&        & -4z^{-1} & +8z^{-2} & -4z^{-3} & \\
\cline{6-8}
  &         &         &&        &          & 7z^{-2}  & -4z^{-3} \\
    &         &         &&      &          & -7z^{-2} & +14z^{-3} & -7z^{-4} \\
\cline{7-9}
  &         &         &&       &           &          & 10z^{-3} & -7z^{-4} \\
    &         &         &&      &          &          & -10z^{-3} & +20z^{-4} ... \\
\cline{8-9}
  &         &         &&      &            &          & & 13z^{-4}... \\
    &         &         &&      &            &          & & -13z^{-4}...
\end{array}
\]
altså bliver diskret-tid-signalet
\begin{align*}
x(n) &= \left\{\underuparrow{1},4,7,10,13,...\right\} \\
& = 3n+1
\end{align*}

\textbf{(b)} \quad anticausal

\[
\renewcommand\arraystretch{1.1}
\begin{array}
{*2r @{\hskip\arraycolsep}c@{\hskip\arraycolsep} *6r}
  &         &         &&      2z & +5z^{1} & +8z^{2} & + 11z^{3} & + 14z^{4} \\
\cline{4-9}
z^{-2} & -2z^{-1} & +1 &\big)& +2z^{-1} & +1 &          &            &            \\
  &         &         &&     -2z^{-1} & +4 & -2z  &            &            \\
\cline{5-7}
  &         &         &&        &  5 & -2z  &&\\
  &         &         &&        & -5 & +10z & -5z^2 & \\
\cline{6-8}
  &         &         &&        &          & 8z  & -5z^2 \\
    &         &         &&      &          & -8z & +16z^2 & -8z^3 \\
\cline{7-9}
  &         &         &&       &           &          & 11z^2 & -8z^3 \\
    &         &         &&      &          &          & -11z^2 & +22z^3 ... \\
\cline{8-9}
  &         &         &&      &            &          & & 14z^3... \\
    &         &         &&      &            &          & & -14z^3...
\end{array}
\]
altså bliver diskret-tid-signalet
\begin{align*}
x(n) &= \left\{...,14,8,5,2,\underuparrow{0}\right\} \\
& = -(3n+1)
\end{align*}

\subsection*{Opgave 3.14}

Bestem det kausale signal $x(n)$ hvis dets z-transformerede er givet ved:

\textbf{(a)} \quad $X(z) = \frac{1+3z^{-1}}{1+3z^{-1}+2z^{-2}}$

Opgaven løses ved "partial fraction" udvidelse.

\begin{align*}
X(z) &= \frac{z^2+3z}{z^2+3z+2} \rightarrow \frac{X(z)}{z}= \frac{z+3}{z^2+3z+2} = \frac{A_1}{z+2}+\frac{A_2}{z+1} \\
\Updownarrow \\
z &= (z+2)A_1+(z+1)A_2 \\
\Updownarrow \\
-1 &= (-1+2)A_1 \rightarrow A_1 = -1, \qquad -2=(-2+1)A_2 \rightarrow A_2=2 \\
\frac{X(z)}{z} &= \frac{-1}{z+2} + \frac{2}{z+1} \rightarrow X(z) = \frac{-z}{z+2}+\frac{2z}{z+1} \\
X(z) &= \frac{-1}{1+2z^{-1}} + \frac{2}{1+z^{-1}} \\
x(n) &= (-2^n+2(-1)^n)u(n)
\end{align*} 

\textbf{(i)} \quad $X(z) = \frac{1-\frac{1}{2}z^{-1}}{1+\frac{1}{2}z^{-1}}$

\begin{align*}
X(z) &= \frac{1}{1+\frac{1}{2}z^{-1}}-\frac{1}{2}\frac{z^{-1}}{1+\frac{1}{2}z^{-1}} \\
x(n) &= \left(-\frac{1}{2}\right)^n u(n) + \frac{1}{2}\left(-\frac{1}{2}\right)^{n-1} u(n-1)
\end{align*}

\textbf{(j)} \quad $X(z) = \frac{1+az^{-1}}{z^{-1}-a}$

\begin{align*}
X(z) &= \frac{\frac{1}{a}+z^{-1}}{\frac{1}{a}z^{-1}-1} = \frac{\frac{1}{a}}{\frac{1}{a}z^{-1}-1} + \frac{z^{-1}}{\frac{1}{a}z^{-1}-1} = -\frac{1}{a} \frac{1}{\frac{1}{a}z^{-1}-1} - \frac{z^{-1}}{\frac{1}{a}z^{-1}-1} \\
x(n) &= -\frac{1}{a} \left(\frac{1}{a}\right)^n u(n) - \left(\frac{1}{a}\right)^{n-1} u(n-1)
\end{align*}